1. Field of the Invention
The present invention relates to a method for maintaining a file system of a computer system, and more specifically, to a method for timely notifying a user to fix errors of a file system.
2. Description of the Prior Art
A file system is a system for managing files of a computer system and is used to efficiently conduct storage, search and update operations of files in the computer system. However, there are many reasons, i.e. power outage, hardware (such as CPU, memory, hard drive, etc.) error, operating system bug, etc., that can cause an error of the file system. Many file systems of operating systems use “error continue” as a mode of operation. When an error occurs in a file system, the file system continues to operate without having to deal with the error. Thus, as the file system accumulates errors from running for a prolonged time, the file system may not be repaired due to the accumulated errors or may need to stop all operations of the computer system and reboot to repair the file system.
In the prior art, the kernel of the Linux operating system may approach the errors in EXT4 file system in three ways:
(a). remount the file system, and the file system is set to read only;
(b). generate kernel panic; and
(c). error continue.
Wherein, approach (a) will keep problems resulted from subsequent write operations of the file system being worse, but the file system would be not updatable; approach (b) will completely stop the entire operating system and the computer system must be rebooted; approach (c) will, as described above, accumulate the errors in the file system. When the errors of the file system continuously accumulate, the file system may not be used properly or not be able to back up data in the file system and result to having corrupt files.
When the file system accumulates excessive number of errors causing the files system not be able to operate normally, the prior art usually restarts the computer system to solve the problem. For example, when a computer system having an Ubuntu® operating system is booting up, there are three ways to determine whether there is a need to conduct file system inspection:    (1) Determine whether unmount is normal: When the file system did not unmount properly during the last shut down of the computer system, the file system may be damaged and an inspection of the file system is needed.    (2) Check the number of mount times: When the number of mount times exceeds a predetermined threshold, an inspection of the file system would be conducted.    (3) Setting the inspection time period: For a file system being rarely remounted or a computer system being rarely rebooted, a time period is set, and when the time from the last file system inspection exceeds the set time period, a file system inspection is conducted.
In addition, the Windows® operating system of Microsoft® may be taken as an example. Such type of computer system will conduct a file system inspection during a reboot after a normal shut down and the administrator may carry out the file system inspection while the computer system is turned on. However, whether the inspection is manually initiated or initiated by error encountered during boot, the computer system lack a mechanism for processing errors encountered at real time. In other words, when the computer system of prior art finds an error in the file system, the error is not immediately responded to, and the problem of the file system will continuously expand until the computer system is rebooted.
However, a computer system requiring a more stable service reboot more rarely, therefore, inspecting the file system during reboot is improper to apply to high-end server. Furthermore, manually inspecting the file system is unsubstantial because the administrator would not know when to inspect the file system. In addition, the current Windows® operating system does not suggest a file system inspection to the administrator.